DEF_PROJECT=../../..
include $(DEF_PROJECT)/scripts/main.mk
name=tar
version=1.22
prefix=/usr
destdir=$(DIR_SYSROOT)
extdeps=eglibc-tools gcc-tools binutils-tools linux-header-tools

DL_SERV=http
DL_HOST=ftp.gnu.org
DL_PATH=gnu/$(name)
DL_SUFFIX=tar.bz2

CFLAGS+=-I$(destdir)/usr/include
LDFLAGS+=-L$(destdir)/usr/lib

cflags+=--host=$(CC_TARGET)
cflags+=--build=$(CC_HOST)
cflags+=--bindir=/bin
cflags+=--libexecdir=$(prefix)/sbin
cflags+=--cache-file=$(DEF_CACHE)

pre-build:
	echo gl_cv_func_wcwidth_works=yes >$(source)/$(DEF_CACHE)
	echo gl_cv_func_btowc_eof=yes >>$(source)/$(DEF_CACHE)
	echo ac_cv_func_malloc_0_nonnull=yes >>$(source)/$(DEF_CACHE)
	echo ac_cv_func_realloc_0_nonnull=yes >>$(source)/$(DEF_CACHE)
	echo gl_cv_func_mbrtowc_incomplete_state=yes >>$(source)/$(DEF_CACHE)
	echo gl_cv_func_mbrtowc_nul_retval=yes >>$(source)/$(DEF_CACHE)
	echo gl_cv_func_mbrtowc_null_arg=yes >>$(source)/$(DEF_CACHE)
	echo gl_cv_func_mbrtowc_retval=yes >>$(source)/$(DEF_CACHE)
	echo gl_cv_func_wcrtomb_retval=yes >>$(source)/$(DEF_CACHE)
	cd $<;$(cdefs) ./configure $(cflags)
